package cn.com.headfree.controller;

import com.aostarit.smcrypto.CipherMode;
import com.aostarit.smcrypto.Sm2Utils;

/**
 * @date created in 2022/6/28 10:54
 */
public class DemoTest {
    private static String publicKey = "040462616C1B5DB30C75EB696E8609B3899C8C1165B958360F4F8C53D26E2EEA4ED3E6E1BD85804A030A27B6DC72ED4FB2C00AB518187D60471234BF257E9BF5C2";
    public static void main(String[] args) throws Exception{


        String fromText = new Sm2Utils(CipherMode.C1C3C2).encryptFromText(publicKey, "需要加密的字段");
        System.out.println(fromText);
    }
}
